module.exports = class ProxyServer {
  constructor(proxyPrefix,proxyPath,isOrigin,isHttps) {
    this._proxyPrefix = proxyPrefix;
    this._proxyPath = proxyPath;
    this._isOrigin = isOrigin;
    this._isHttps = isHttps;
  }


  get proxyPrefix() {
    return this._proxyPrefix;
  }

  set proxyPrefix(value) {
    this._proxyPrefix = value;
  }

  get proxyPath() {
    return this._proxyPath;
  }

  set proxyPath(value) {
    this._proxyPath = value;
  }

  get isOrigin() {
    return this._isOrigin;
  }

  set isOrigin(value) {
    this._isOrigin = value;
  }

  get isHttps() {
    return this._isHttps;
  }

  set isHttps(value) {
    this._isHttps = value;
  }

  getProxy(){
    let server={};
    server[this._proxyPrefix]={};
    server[this._proxyPrefix].target=this._proxyPath;
    server[this._proxyPrefix].changeOrigin=this._isOrigin;
    server[this._proxyPrefix].secure=this._isHttps;
    server[this._proxyPrefix].pathRewrite={};
    server[this._proxyPrefix].pathRewrite['^'+this._proxyPath]='';
    return server;
  }

}
/*export default function ProxyServer(proxyPrefix,proxyPath,isOrigin,isHttps){
  this._proxyPrefix = proxyPrefix;
  this._proxyPath = proxyPath;
  this._isOrigin = isOrigin;
  this._isHttps = isHttps;
  function getProxy(){
    let server={};
    server[this._proxyPrefix]={};
    server[this._proxyPrefix].target=this._proxyPath;
    server[this._proxyPrefix].changeOrigin=this._isOrigin;
    server[this._proxyPrefix].secure=this._isHttps;
    server[this._proxyPrefix].pathRewrite={};
    server[this._proxyPrefix].pathRewrite['^'+this._proxyPath]='';
    return server;
  }
}*/

